package com.lijie.ljblog.service;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author lijie
 * @Date 2022/10/22 15:46
 **/
@Component
public  class GameCalculateContext {
    private static final Map<String, GameService> registerMap = new HashMap<>();

    //获取游戏实现类
    public static GameService getGameService(String gameName){
        return registerMap.get(gameName);
    }
    //注册游戏实现类
    public static void registerGameService (String gameName,GameService gameService){
        registerMap.put(gameName,gameService);

    }
}
